package com.ykt.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Page;
import com.ykt.interceptor.Seach;



public class ProductType extends SeachModel<ProductType>{
	private static final long serialVersionUID = 1L;
	public static final ProductType dao = new ProductType();
	
	public Page<ProductType> paginate(int pageNumber,int rows,Seach seach){
		return paginateHasShop(pageNumber, rows, seach);
	}
	//得到商户
	public Shop getShop(){
		return Shop.dao.findById(getInt("shop_id"));
	}
	public List<ProductType> findByPid(Integer pid,Integer shopId){
		return dao.find("select * from product_type where pid = ? and shop_id=? ", pid,shopId);
	}
	public List<ProductType> getSubType(){
		return dao.find("select * from product_type where pid = ?", get("id"));
	}
}
